package com.yuexunit.operationman.nbsy.module.OperationRiskAssessment;

import android.content.Context;
import android.content.res.Resources;

import com.yuexunit.operationman.nbsy.R;
import com.yuexunit.operationman.nbsy.module.OperationRiskAssessment.bean.RiskAssessmentBean;

import java.util.ArrayList;

/**
 * Created by work-jx on 2017/8/14.
 */
public class RiskAssessmentContracts {
    public static final ArrayList<RiskAssessmentBean.ObjectEntity.RiskItemListEntity> riskItemListEntities(Context context)
    {
        Resources res =context.getResources();
        String[] languages = res.getStringArray(R.array.riskassessment);
        ArrayList<RiskAssessmentBean.ObjectEntity.RiskItemListEntity> riskItemListEntities = new ArrayList<>();
        for(int i = 0; i<languages.length;i++)
        {
            RiskAssessmentBean.ObjectEntity.RiskItemListEntity riskItemListEntity = new RiskAssessmentBean.ObjectEntity.RiskItemListEntity();
            riskItemListEntity.setItemCode(languages[i]);
            riskItemListEntity.setItemValue("");
            riskItemListEntity.setItemName("");
            riskItemListEntity.setRiskId("");
            riskItemListEntity.setRiskItemId("");
            riskItemListEntities.add(riskItemListEntity);
        }
        return riskItemListEntities;
    };

    public static final ArrayList<RiskAssessmentBean.ObjectEntity.RiskItemListEntity> riskItemListEntities_new(Context context)
    {
        Resources res =context.getResources();
        String[] languages = res.getStringArray(R.array.riskassessment);
        ArrayList<RiskAssessmentBean.ObjectEntity.RiskItemListEntity> riskItemListEntities = new ArrayList<>();
        for(int i = 0; i<languages.length;i++)
        {
            RiskAssessmentBean.ObjectEntity.RiskItemListEntity riskItemListEntity = new RiskAssessmentBean.ObjectEntity.RiskItemListEntity();
            riskItemListEntity.setItemCode(languages[i]);
            riskItemListEntity.setItemName("");
            riskItemListEntity.setRiskId("");
            riskItemListEntity.setRiskItemId("");
            switch (languages[i]) {
                case "QK_L":
                    riskItemListEntity.setItemValue(";");
                    break;
                case "MZ_P":
                    riskItemListEntity.setItemValue(";");
                    break;
                case "SJ_T":
                    riskItemListEntity.setItemValue(";");
                    break;
                case "LB_K":
                    riskItemListEntity.setItemValue("");
                    break;
                case "LB_JZ":
                    riskItemListEntity.setItemValue("");
                    break;
                case "suiFang":
                    riskItemListEntity.setItemValue("");
                    break;
                case "qieKou":
                    riskItemListEntity.setItemValue("");
                    break;
                default:
                    riskItemListEntity.setItemValue("");
                    break;
            }
            riskItemListEntities.add(riskItemListEntity);
        }
        return riskItemListEntities;
    };
}
